/*
 * @Author: your name
 * @Date: 2022-03-23 15:34:51
 * @LastEditTime: 2022-04-19 20:07:36
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \22-03-19 智慧社区\pages\info\index.js
 */
import { comm } from '../../behaviors/index'
import Message from '../../api/message'
import dayjs from '../../utils/dayjs'
import _ from '../../utils/lodash/index'
Page({
  data: {
    nvabarData: {
      navigationBarTextStyle: 'black', // 胶囊主题 white || black
      navigationBarBackground: '#FEFEFE', // 导航栏背景色
      navigationBarTitleText: '通知提醒',
    },
    messageList: [],
  },

  onLoad: function () {
    wx.showLoading()
    let _that = this
    Message.messageList()
      .then(({ data }) => {
        data.forEach(function (item) {
          item.create_time = dayjs(item.create_time).format('YYYY-MM-DD HH:mm')
        })
        _that.setData({
          messageList: data,
        })
      })
      .catch((err) => [])
      .finally(() => {
        wx.hideLoading()
      })
  },
})
